<!DOCTYPE html>
<html lang="en" class="h100">
<head>
    <title>{$web_title}</title>
    {include file='public/public_head' /}
</head>
<body>
    <div class="main-wrap profile-wrap">
        <div class="content">
            <!-- banner-wrap -->
            <div class="banner-wrap profile-banner-wrap pic-wrap">
                <img src="__INDEX__/img/img_banner_profile.png" alt="" class="swiper-slide-img pic-img banner-img" />
            </div>

            <!-- user-profile-wrap -->
            <div class="comment-item-wrap user-profile-wrap">

                <div class="top-wrap user-info-wrap flex rcb">
                    <div class="left-wrap user-info-detail">
                        <div class="user-info-item flex rss">
                            <div class="item-title">姓名：</div>
                            <div class="item-con">{$userInfo.name}</div>
                        </div>
                        <div class="user-info-item flex rss">
                            <div class="item-title">年龄：</div>
                            <div class="item-con">{$userInfo.age}</div>
                        </div>
                        <div class="user-info-item flex rss">
                            <div class="item-title">爱好：</div>
                            <div class="item-con">{$userInfo.hobby}</div>
                        </div>
                        <div class="user-info-item flex rss">
                            <div class="item-title">就读学校：</div>
                            <div class="item-con">{$userInfo.school}</div>
                        </div>
                    </div>
                    <div class="pic-wrap user-profile-img-wrap">
                        <img src="{$userInfo.img}" alt="" class="pic-img user-profile-img" />
                    </div>
                </div>
                <div class="bot-wrap user-profile-text-wrap">服务宣言：{$userInfo.declaration}</div>
            </div>

            <!-- comment-list-wrap -->
            <div class="content-item-wrap comment-wrap">
                <div class="content-title-wrap flex rcs">
                    <div class="title">总评价</div>
                    <div id="user-rate-value" class="list-wrap rate-wrap"></div>
                </div>
                <ul class="list-wrap comment-list-wrap">
                    {volist name="comment_list" id="vo"}
                    <li class="list-item comment-list-item">
                        <div class="comment-top-wrap comment-info-wrap flex rcb">
                            <div class="left-wrap user-info-wrap flex rcs">
                                <div class="pic-wrap user-avatar-wrap">
                                    <img src="{$vo.avatar}" alt="" class="pic-img user-avatar-img" />
                                </div>
                                <div class="user-name-wrap">
                                    <div class="user-name">{$vo.nickname}</div>
                                    <div class="comment-time">{$vo.create_time|date='Y-m-d H:i'}</div>
                                </div>
                            </div>
                            <ul class="list-wrap right-wrap rate-wrap flex rcs">{$vo.comment_star_str | raw}</ul>
                        </div>
                        <div class="comment-bot-wrap comment-detail-wrap">
                            <ul class="list-wrap comment-tag-wrap flex rcs wrap">
                                {volist name="vo['tag_app_text']" id="tag"}
                                <li class="list-item comment-tag-item">{$tag}</li>
                                {/volist}
                            </ul>
                            <div class="comment-text-wrap text-j">{$vo.comment}</div>
                        </div>
                    </li>
                    {/volist}
                </ul>
                {empty name="comment_list"}
                    <div class="empty-wrap pic-wrap empty-pic-wrap flex ccc">
                        <p class="icon icon-no-comment"></p>
                    </div>
                {/empty}
            </div>

            <!-- other -->
            <div class="btn-wrap fix-btn-wrap pos-f" id="sss">
                <a class="btn-item comment-btn-item flex ccc icon icon-home" href='{:url("/index/index/index")}'>返回首页</a>
            </div>

        </div>
    </div>
    {include file='public/footer' /}

    <script src="__COMMON__/layui/layui.js"></script>
    <script>
        layui.use(['rate', 'layer'], function(){
            let rate = layui.rate;
            let layer = layui.layer;

            rate.render({
                elem: '#user-rate-value',
                value: '{$star}',
                readonly: true
            });

            var is_commentted = {$is_commentted};
            var is_commentting = {$is_commentting};
            var userInfo = '';
            console.log('is_commentted, is_commentting---->', is_commentted, is_commentting, userInfo);

            if (is_commentted < 1 && is_commentting > 0) {
                layer.open({
                    type: 2,
                    anim: 2,
                    closeBtn: 0,
                    move: false,
                    title: false,
                    offset: 'lb',
                    area: ['100vw', '70vh'],
                    shadeClose: false,
                    content: '{:url("/index/index/comment")}?id={$userInfo.id}',
                });
            }
        });
    </script>
</body>
</html>